import Func from '@/utils/functions'

const proxy = {
    async login(params = {}, header = {}) {
        return uni.request({
            url: '/v1/user/login',
            method: 'POST',
            data: params,
            header
        })
    },
    async register(params = {}, header = {}) {
        return uni.request({
            url: '/v1/user/register',
            method: 'POST',
            data: params,
            header
        })
    },
    async sendsms(params = {}, header = {}) {
        return uni.request({
            url: '/v1/user/sendsms',
            method: 'POST',
            data: params,
            header
        })
    }
}

const p = Func.proxyEndpoint(proxy)

export const login = p.login
export const register = p.register
export const sendsms = p.sendsms